package io.gitee.zicai.redisson.rpc.sample.consumer.controller;

import io.gitee.zicai.redisson.rpc.annotation.RedissonRpcClient;
import io.gitee.zicai.redisson.rpc.sample.api.IRpcDemoService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * RocDemoController
 *
 * @author zicai
 * @since 2021-03-26
 */
@Slf4j
@Api(tags = "rpc测试接口")
@RestController
@RequestMapping("/rpc/demo")
public class RocDemoController {

    @RedissonRpcClient
    private IRpcDemoService rpcDemoService;

    @GetMapping("/hello")
    public String hello(String msg) {
        log.info(">>> invoke rpcDemoService.hello()");
        return rpcDemoService.hello(msg);
    }
}
